package com.ganbo.stock.task;

import com.ganbo.stock.config.StockJobSwitchConfig;
import com.ganbo.stock.service.impl.BigDealService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * 当天逐笔大单交易
 *
 * @Author: ganbo
 * @Date: 2020/12/28 18:04
 */

@Component
@Slf4j
public class BigDealJob {

    @Autowired
    BigDealService bigDealService;
    @Autowired
    StockJobSwitchConfig switchConfig;


    @Scheduled(cron = "0 0 20 * * ? ") //每天晚上八点统计当天股票的逐笔大单交易
    public void updateCompanyInfoTask() {
        if (switchConfig.isCompanyJob()) {
            bigDealService.fetchDayBigDeal();
            log.info("获取当天逐笔大单交易 end.");
        }
    }


}
